// 实现自己的delay
async function test() {
    console.log(1);
    await delay(1000);
    console.log(2);
}
test()

/**
 * 实现暂停n秒
 * @param {number} timeout 
 */
async function delay(timeout) {
    return new Promise(function(resolve, reject) {
        setTimeout(() => {
            resolve()
        }, timeout)
    })
}
